
class Dog(object):

    def __new__(cls, *args, **kwargs):
        print("dog is coming")
        
        return super().__new__(cls)

    def __init__(self,name):
        self.name = name

    def game(self):
        print("%s jumpping jumpping !" % self.name)

class XiaoTianDog(Dog):

    def game(self):
        print("%s flying flying" % self.name)

class Person(object):

    def __init__(self,name):
        self.name = name

    def game_with_dog(self,dog):

        print("%s play with %s ..." % (self.name,dog.name))

        dog.game()

if __name__ == "__main__":

    twoha = Dog("xiaobai")

    xiaoming = Person("kobe")

    xiaotian = XiaoTianDog("xiaotian")

    xiaoming.game_with_dog(twoha)

    xiaoming.game_with_dog(xiaotian)

    # xiaoming.game_with_dog(xiaoming)


